import React, { Component } from 'react'
import { Text, View, FlatList, Image, ScrollView } from 'react-native'
import { members } from './member.json'

export default class Member extends Component {

    componentDidMount() {
        console.log(members)
    }

    render() {
        return (
            <ScrollView>
                <View style={{flex: 1, justifyContent: 'center',alignItems:'center',marginTop:10 }}>
                    <View style={{flexDirection:'row',justifyContent:'center',flexWrap:'wrap',alignItems:'center',width: 360,}}>
                    {members.map((member, index) => {
                        return <View style={{ justifyContent: 'center', alignItems: 'center',padding:13 }} key={index}>
                            <Image style={{ width: 140, height: 180, backgroundColor: "white" }} source={{uri:"http://johnyu.cn/s182/"+member.id+'.jpg'}}/>
                            <Text style={{ fontSize: 15 }}>{member.name}</Text>
                            <Text style={{ fontSize: 15 }}>学号:{member.id}</Text>
                        </View>
                    })}                          
                    </View>
                </View>
            </ScrollView>
        )
    }
}
